home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
StringListBoxEditor.cpp
< prev
next >
Wrap
Text File
|
1997-05-11
|
4KB
|
131 lines
/*
* File: StringListBoxEditor.cpp
* Summary: A view that knows how to edit a TStringListBox.
* Written by: Jesse Jones
*
* Copyright ゥ 1997 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <-> 1/22/97 JDJ Created
*/
#include "StringListBoxEditor.h"
#include <ZControl.h>
#include <ZTextBox.h>
#include "RsrcPopupMenu.h"
// ===================================================================================
// class CEditStringListBoxCommand
// ===================================================================================
//---------------------------------------------------------------
//
// CEditStringListBoxCommand::~CEditStringListBoxCommand
//
//---------------------------------------------------------------
CEditStringListBoxCommand::~CEditStringListBoxCommand()
{
}
//---------------------------------------------------------------
//
// CEditStringListBoxCommand::CEditStringListBoxCommand
//
//---------------------------------------------------------------
CEditStringListBoxCommand::CEditStringListBoxCommand(TStringListBox* pane, const SStringListBoxInfo& oldInfo, const SStringListBoxInfo& newInfo) : Inherited(pane, oldInfo, newInfo)
{
}
//---------------------------------------------------------------
//
// CEditStringListBoxCommand::UpdatePane
//
//---------------------------------------------------------------
void CEditStringListBoxCommand::UpdatePane(const SStringListBoxInfo& info)
{
mPane->SetTypeAhead(info.useTypeAhead);
mPane->SetTextTraits(info.traitsID);
}
#pragma mark -
// ===================================================================================
// CStringListBoxEditor
// ===================================================================================
static TReanimatorRegister<CStringListBoxEditor> sStringListBoxEditorRegistrar;
//---------------------------------------------------------------
//
// CStringListBoxEditor::~CStringListBoxEditor
//
//---------------------------------------------------------------
CStringListBoxEditor::~CStringListBoxEditor()
{
}
//---------------------------------------------------------------
//
// CStringListBoxEditor::CStringListBoxEditor
//
//---------------------------------------------------------------
CStringListBoxEditor::CStringListBoxEditor(TView* superView) : Inherited(superView)
{
}
//---------------------------------------------------------------
//
// CStringListBoxEditor::Create [static]
//
//---------------------------------------------------------------
MReanimatable* CStringListBoxEditor::Create(MReanimatable* parent)
{
return new CStringListBoxEditor(dynamic_cast<TView*>(parent));
}
//---------------------------------------------------------------
//
// CStringListBoxEditor::GetEditorInfo
//
//---------------------------------------------------------------
SStringListBoxInfo CStringListBoxEditor::GetEditorInfo() const
{
SStringListBoxInfo info;
TControl* control = dynamic_cast<TControl*>(this->FindSubPane("Type Ahead"));
info.useTypeAhead = control->GetValue();
CRsrcPopupMenu* popup = dynamic_cast<CRsrcPopupMenu*>(this->FindSubPane("Traits ID"));
info.traitsID = popup->GetID();
return info;
}
//---------------------------------------------------------------
//
// CStringListBoxEditor::SetEditorInfo
//
//---------------------------------------------------------------
void CStringListBoxEditor::SetEditorInfo(const SStringListBoxInfo& info)
{
TControl* control = dynamic_cast<TControl*>(this->FindSubPane("Type Ahead"));
control->SetValue(info.useTypeAhead);
CRsrcPopupMenu* popup = dynamic_cast<CRsrcPopupMenu*>(this->FindSubPane("Traits ID"));
popup->SetID(info.traitsID);
}